SQL Database Server

ASP .NET Tables

At the core of any website that has interaction with customers is a database that stores information on/for the customers and the owners' services\product lines. I chose to use a SQL Server to store all the information needed for my website because of ASP .NET's direct accessibility to SQL. By default, ASP .NET creates a local server called ASPNETDB that has predefined tables to securely control user information. Since I am hosting my site with godaddy.com, I created a similar database on their server called barnessql. In order for my website to access this database, a modification to the web.config was needed and is listed below.
<connectionStrings>
  <remove name="LocalSqlServer" />
  <add name="LocalSqlServer" connectionString="Data Source=barnessql.db.6213163.hostedresource.com; Initial Catalog=barnessql; User ID=###OMITTED##; Password='###OMITTED##';"
   providerName="System.Data.SqlClient" />
  <add name="BarnesDatabaseConnection" connectionString="Data Source=barnessql.db.6213163.hostedresource.com; Initial Catalog=barnessql; User ID=###OMITTED##; Password='###OMITTED##';"
   providerName="System.Data.SqlClient" />
  <add name="barnessqlConnectionString1" connectionString="Data Source=barnessql.db.6213163.hostedresource.com;Initial Catalog=barnessql;Persist Security Info=True;User ID=###OMITTED##;Password=###OMITTED##"
   providerName="System.Data.SqlClient" />
</connectionStrings>

The default tables are shown below.
defaultTables.PNG
Each table works together to store information collected when a user creates an account and help manage what the user can access on the website (called a Roles ). These tables, by default, when used with with the Login ASP .NET controls provide management of all users data and roles within the website.

ComputerSubmissions Table

In order to store the customers submissions for Computer Questions\Repairs, I created my own table to the database called ComputerSubmissions. This table stores all the information that customers submits from the website during a Computer Question Request. The schema for the table is shown below.
submissionTAble.PNG The customer provides the information for the Subject, Body, and Telephone columns by using the web form below.
submitForm.PNG
When the customer hits the submit button, each field is stored along with a time stamp, and current user signed in. All this information is stored inside the ComputerSubmissions table. The ID column is set to auto-increment and is update for each new entry. The code to perform this action is listed below.

string subject = SubjectTB.Text;
string body = BodyTB.Text;
string phone = PhoneTB.Text;
string username = User.Identity.Name;
 
SqlConnection connection = new SqlConnection(connectionString);
string query = "INSERT INTO ComputerSubmissions (UserName, Subject, Body, Phone, DateSubmitted)" +
    " VALUES('" + username + "', '" + subject + "', '" + body + "', '" + phone + "', '" + DateTime.Now + "')";
SqlCommand command = new SqlCommand(query, connection);
connection.Open();
command.ExecuteNonQuery();
connection.Close();